{extend name="layout"}
{block name="content"}

<!-- wrapper-content -->
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">

        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h5>安全设置</h5>
                    <div class="ibox-tools">
                        <a href="javascript:;" title="刷新" class="page-reload">
                            <i class="fa fa-refresh"></i>
                        </a>
                        <a onclick="javascript:history.back(-1);return false;" href="javascricp:;" title="返回">
                            <i class="fa fa-reply"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form action="" name="form-builder" method="post" id="form">
                        <div class="form-group row"><label class="col-sm-2 col-form-label"><span
                                    class="text-danger">*</span>旧的登录密码</label>
                            <div class="col-md-10"><input type="password" name="oldpassword" class="form-control"
                                    placeholder="请输入旧的登录密码"><span
                                    class="form-text m-b-none">请输入旧密码来验证修改权限，旧密码不限制格式。</span></div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group row"><label class="col-sm-2 col-form-label"><span
                                    class="text-danger">*</span>新的登录密码</label>
                            <div class="col-md-10"><input type="password" name="password" id="password"
                                    class="form-control" placeholder="请输入新的登录密码"><span
                                    class="form-text m-b-none">密码必需包含大小写字母、数字、符号的任意两者组合。</span></div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group row"><label class="col-sm-2 col-form-label"><span
                                    class="text-danger">*</span>重复登录密码</label>
                            <div class="col-md-10"><input type="password" class="form-control" name="repassword"
                                    placeholder="请重复输入登录密码"><span
                                    class="form-text m-b-none">密码必需包含大小写字母、数字、符号的任意两者组合。</span></div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group row">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary btn-lg ajax-post" target-form="form-builder"
                                    type="submit">保存更改</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>


{/block}


{block name="script"}
<script>
    $(document).ready(function () {

        $("#form").validate({
            rules: {
                oldpassword: {
                    required: true,
                    minlength: 6
                },
                password: {
                    required: true,
                    minlength: 6
                },
                repassword: {
                    required: true,
                    minlength: 6,
                    equalTo: "#password"
                },
            },
            messages: {
                oldpassword: {
                    required: "请输入旧的登录密码",
                    minlength: "登录密码长度不能小于6"
                },
                password: {
                    required: "请输入新的登录密码",
                    minlength: "登录密码长度不能小于6"
                },
                repassword: {
                    required: "请重复输入登录密码",
                    minlength: "登录密码长度不能小于6",
                    equalTo: "请再次输入相同的密码"
                },
            }
        });
    });
</script>
{/block}